<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>02-jsx小练习</title>
    <!-- react核心组件库 -->
    <script src="../其他/js/react.development.js"></script>
    <script src="../其他/js/react-dom.development.js"></script>

    <!-- Don't use this in production: -->
    <script src="../其他/js/babel.min.js"></script>
</head>

<body>
    <div id="root"></div>


    <!-- 此处一定要写babel -->
    <script type="text/babel">
      // 模拟一些数据
      const data = ['Angular', 'React', 'Vue']
      // 1.创建虚拟dom
      // js表达式和语句注意区分
      const VDOM = (
        <div>
          <h1>前端框架列表</h1> 
          <ul>
            {
              data.map((item, index) => {
                return <li key={index}>{item}</li>
              })
            }
          </ul>
        </div>
      )
      // 2.渲染
      ReactDOM.render(VDOM,document.getElementById('root'))
    </script>
</body>

</html>